package com.lebang.feign;

import com.lebang.feign.fallback.JokeEarnedFallback;
import com.lebang.model.RequestUserInfo;
import com.lebang.model.back.Result;
import com.lebangweb.response.JsonData;
import io.swagger.annotations.ApiOperation;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author xwj
 */
@FeignClient(name = "wangzhuan-earns", contextId = "wangzhuan-earns-joke", fallback = JokeEarnedFallback.class)
public interface JokeEarnedFeign {

    /**
     * 开关 --app
     *
     * @param request
     * @return
     */
//    @Require
//    @Sessionid
    @ApiOperation("开关")
    @PostMapping("/joke/enable")
    JsonData enable(@RequestBody RequestUserInfo request, @RequestParam(value = "key", required = false) String key);

    /**
     * 任务列表 --app
     *
     * @param request
     * @return
     */
    @ApiOperation("任务列表")
    @PostMapping("/joke/list")
    JsonData list(@RequestBody RequestUserInfo request, @RequestParam(value = "key", required = false) String key);

    /**
     * 领取任务 --app
     *
     * @param request
     * @return
     */
    @ApiOperation("领取任务")
    @PostMapping("/joke/pull")
    JsonData pull(@RequestBody RequestUserInfo request);

    /**
     * 提交任务 --app
     *
     * @param request
     * @return
     */
    @ApiOperation("提交任务")
    @PostMapping("/joke/push")
    Result<Integer> push(@RequestBody RequestUserInfo request, @RequestParam(value = "id", required = false) Long id);


    /**
     * 双倍 --app
     * @param request
     * @param id
     * @return
     */
    @ApiOperation("双倍")
    @PostMapping("/joke/double")
    Result<Integer> doubleCount(@RequestBody RequestUserInfo request, @RequestParam(value = "id", required = false) Long id);
    /**
     * 获取今日已做次数
     *
     * @param request 请求数据
     * @return 返回结果
     */
    @ApiOperation("获取今日已做次数")
    @PostMapping("/joke/total")
    Result<Integer> total(@RequestBody RequestUserInfo request) ;
}
